
from tortoise import fields, models

from app.models.simulation_result_total import SimulationResultTotal


class Simulation(models.Model):
    simulation_id = fields.IntField(pk=True)
    env_param_id = fields.IntField()
    name = fields.CharField(max_length=255, null=True)
    created_at = fields.DatetimeField(auto_now_add=True)

    # 关联仿真结果总表（设为一对多）
    results: fields.ReverseRelation["SimulationResultTotal"]

    class Meta:
        table = "simulation"

